<template>
	<view class="pilicy-item" @click="handleToFinish(info)">
		<view class="title-tools" v-if="showName">
			<title-tools :title="info.fq_name_text" fontSize="30rpx"></title-tools>
		</view>
		<view class="title">
			{{info.title}}
		</view>
		<view class="info">
			<view class="time-group">
				<view class="start-time">
					接收时间：{{info.createtime | formatDate}}
				</view>
				<view class="end-time" v-if="info.solvetime">
					完结时间：{{info.solvetime | formatDate}}
				</view>
				<!-- <view class="end-time">
					超时时间：{{info. | formatDate}}
				</view> -->
			</view>
			<view class="btn" v-if="info.sh_status == 1">
				待审核
			</view>
			<view class="btn" v-if="info.sh_status == 2">
				已审核
			</view>
			<view class="btn" v-if="info.sh_status == 3">
				已驳回
			</view>
		</view>
	</view>
</template>

<script>
	import TitleTools from '@/components/title-tools/TitleTools.vue'
	export default {
		name: 'PilicyItem',
		components: { TitleTools },
		props: {
			info: {
				type: Object,
				default() {
					return {}
				}
			},
			showName: {
				type: Boolean,
				default: false
			},
			//是否超时
			type: {
				type: Boolean,
				default: false
			}
		},
		created() {
			console.log(this.type)
		},
		data() {
			return {
				level: getApp().globalData.level
			}
		},
		methods: {
			//跳转已办事项详情页
			handleToFinish (info) {
				// if (info.is_urge_organization == 2) return
				this.$emit('click', info)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.pilicy-item {
		padding-bottom: 30rpx;
		// margin-bottom: 30rpx;
		.title {
			font-size: 30rpx; 
			font-weight: 500;
			color: #000000;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			-webkit-line-clamp: 2;
		}
		
		.info {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 29rpx;
			.time-group {
				font-size: 24rpx;
				color: #929292;
			}
			.btn {
				font-size: 28rpx;
				color: #FFFFFF;
				width: 180rpx;
				height: 50rpx;
				line-height: 50rpx;
				text-align: center;
				background: #196EFF;
				border-radius: 25rpx;
			}
		}
		&:nth-last-child(2){
			border: none;
			margin-bottom: 0;
			// padding-bottom: 0;
		}
	}
	
	.title-tools {
		margin-bottom: 30rpx;
	}
</style>
